#! /bin/bash
#kafka.sh start/stop
#1、判断参数是否传入
if [ $# -lt 1 ]
then
	echo "必须传入start/stop..."
	exit
fi
#2、根据参数启动/停止
case $1 in
"start")
	for host in hadoop102 hadoop103 hadoop104
	do
		echo "==========$host=========="
		ssh $host "/opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties"
	done
;;
"stop")
	for host in hadoop102 hadoop103 hadoop104
	do
		echo "==========$host=========="
		ssh $host "/opt/module/kafka/bin/kafka-server-stop.sh"
	done
;;
*)
	echo "参数输入错误..."
;;
esac
